#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include "nfcsettings.h"
#include "qdeclarative.h"
#include <QtCore/QLocale>
#include <QtCore/QTranslator>
#include <QtCore/QTextCodec>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

	// localization support
    QString locale = QLocale::system().name();
    QTranslator translator;
    translator.load(QString("QuickNFC_") + locale);
    app.installTranslator(&translator);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));

	// register the NfcSettings class with Qt Quick
    qmlRegisterType<NfcSettings>("NfcSettings", 1, 0, "NfcSettings");
	
	// instantiate the view
	QmlApplicationViewer viewer;
    viewer.setMainQmlFile(QLatin1String("qml/QuickNFC/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
